﻿Imports System.Net
Imports System.IO

Public Class Image
    Const m_dest = "C:\\hashGrab\\Images\\"
    Public m_imageList As List(Of String)
    Private Shared m_logger As LogWriter

    Public Sub New()
        Dim logger As LogWriter = New LogWriter()
        m_logger = logger
    End Sub

    Public Function downloadimages(imageslist As List(Of String)) As Boolean
        Dim client As New WebClient

        For Each item In imageslist
            client.DownloadFile(item, m_dest & Path.GetFileName(item))
        Next
        Return True

    End Function

    Public Sub getNumberOfImages()
        m_logger.writeImagesDownloaded(My.Computer.FileSystem.GetFiles(m_dest).Count())
    End Sub




End Class
